/*
 * @Description: 
 * @Author: zml
 * @Date: 2025-07-31 14:45:31
 * @LastEditors: zml
 * @LastEditTime: 2025-07-31 14:49:58
 */
import { useSelector } from 'react-redux';
import type { RootState } from '../store';
export const hasPerm = (hasPermKey: any) => {
  let permissions = useSelector((state: RootState) => state.userData.permissions);
  let userinfo = useSelector((state: RootState) => state.userData.userinfo);
  return userinfo.username == 'admin' ? true : permissions.includes(hasPermKey)
}